<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>明细级库存调整管理</title>
    <link rel="stylesheet" href="http://static-online.zhaogangtest.com/publicresource/css/bootstrap-table.css">
    <link rel="stylesheet" href="../../../resources/public/css/table.css">
    <link rel="stylesheet" href="../../../resources/public/css/bootstrap-table-fixed-columns.css">
    <link rel="stylesheet" href="http://static-online.zhaogangtest.com/publicresource/control/daterangpicker/daterangepicker-bs3.css">
    <link rel="stylesheet" href="../../../resources/public/css/iconfont.min.css">
    <link rel="stylesheet" href="../../../resources/public/css/scmstrap.css">
</head>

<body>
    <div class="main">
        <!-- 条件区域 -->
        <div class="form-list">
            <div class="group">
                <label>调整单号</label>
                <div class="scm-input-wrap">
                    <input type="text" class="scm-input">
                </div>
            </div>
            <div class="group group-select">
                <label>调整仓库</label>
                <div class="selectshow selectshowAction scm-input-wrap">
                    <input type="text" class="scm-input hand" readonly="" placeholder="全部">
                </div>
                <ul class="select" style="display: none;">
                    <li>上海钢富信息科技有限公司上海钢富信息科技有限公司</li>
                    <li>上海钢找塑料</li>
                    <li>上海找油网信息科技</li>
                </ul>
            </div>
            <div class="group group-select">
                <label>调整库房</label>
                <div class="selectshow selectshowAction scm-input-wrap">
                    <input type="text" class="scm-input hand" readonly="" placeholder="全部">
                </div>
                <ul class="select" style="display: none;">
                    <li>上海钢富信息科技有限公司上海钢富信息科技有限公司</li>
                    <li>上海钢找塑料</li>
                    <li>上海找油网信息科技</li>
                </ul>
            </div>
            <div class="group group-select">
                <label>状态</label>
                <div class="selectshow selectshowAction scm-input-wrap">
                    <input type="text" class="scm-input hand" readonly="" placeholder="全部">
                </div>
                <ul class="select" style="display: none;">
                    <li>上海钢富信息科技有限公司上海钢富信息科技有限公司</li>
                    <li>上海钢找塑料</li>
                    <li>上海找油网信息科技</li>
                </ul>
            </div>
            <div class="group group-select">
                <label>制单人</label>
                <div class="selectshow selectshowAction scm-input-wrap">
                    <input type="text" class="scm-input hand" readonly="" placeholder="全部">
                </div>
                <ul class="select" style="display: none;">
                    <li>上海钢富信息科技有限公司上海钢富信息科技有限公司</li>
                    <li>上海钢找塑料</li>
                    <li>上海找油网信息科技</li>
                </ul>
            </div>
            <div class="group group-data">
                <label>制单时间</label>
                <div class="scm-input-wrap">
                    <i class="anticon icon-calendar"></i>
                    <input type="text" class="scm-input active" id="datepicker" placeholder="开始时间  ~  结束时间">
                </div>
            </div>
        </div>
        <!-- 按钮 -->
        <div class="operation">
            <div class="conditionbtn">
                <button class="scm-btn blue">
                    <i class="anticon icon-search1"></i>搜索</button>
                <button class="scm-btn">
                    <i class="anticon icon-retweet"></i>重置</button>
            </div>
            <div class="scm-btn-group fr">
                <button class="scm-btn btn-refresh">
                    <i class="anticon icon-reload1"></i>刷新
                </button>
                <button class="scm-btn btn-adjust-item">
                    <i class="anticon icon-edit1"></i>修改
                </button>
                <button class="scm-btn btn-delete-item">
                    <i class="anticon icon-delete"></i>废弃
                </button>
                <button class="scm-btn btn-account">
                    <i class="anticon icon-isv"></i>结单
                </button>
            </div>
        </div>
        <div class="box-table">
            <table class="table table-condensed" id="table-parent"></table>
        </div>
    </div>
    <!-- 修改 -->
    <div class="layer-adjust-item" style="display: none;">
        <div class="main">
            <!-- 条件区域 -->
            <div class="form-list form-list-btn-inner nofloat">
                <p class="layer-tips"><i class="anticon icon-exclamationcircle fs17 brown"></i>未选中，无法进行修改</p>
            </div>
        </div>
    </div>
     <!-- 废弃 -->
    <div class="layer-delete-item" style="display: none;">
        <div class="main">
            <!-- 条件区域 -->
            <div class="form-list form-list-btn-inner nofloat">
                <p class="layer-tips"><i class="anticon icon-exclamationcircle fs17 brown"></i>未选中待废弃的记录</p>
            </div>
        </div>
    </div>
     <!-- 结单 -->
    <div class="layer-account" style="display: none;">
        <div class="main">
            <!-- 条件区域 -->
            <div class="form-list form-list-btn-inner nofloat">
                <p class="layer-tips"><i class="anticon icon-exclamationcircle fs17 brown"></i>请选中需要结单的调整单</p>
            </div>
        </div>
    </div>
    <script src="http://static-online.zhaogangtest.com/publicresource/js/require.js"></script>
    <script>
    var page;

    require.config({
        paths: {
            "jquery": "../../../resources/public/js/jquery.min",
            "bootstrap": 'http://static-online.zhaogangtest.com/publicresource/js/bootstrap.min',
            // "bootstrap-table": "http://static-online.zhaogangtest.com/publicresource/js/bootstrap-table",
            "bootstrap-table": "../../../resources/public/js/bootstrap-table",
            "moment": "http://static-online.zhaogangtest.com/publicresource/control/daterangpicker/moment.min",
            "daterangepicker": "../../../resources/public/js/daterangepicker",
            "layer": 'http://static-online.zhaogangtest.com/publicresource/control/layer/layer.min',
            "public": "../../../resources/public/js/public",
            "chinese": "../../../resources/public/js/chinese",
            "bootstrap-table-fixed": "../../../resources/public/js/bootstrap-table-fixed-columns",
            "autocomplete": "../../../resources/public/js/jquery.autocomplete",
        },
        shim: {
            "jquery": {
                exports: ['jQuery', '$']
            },
            "bootstrap": {
                deps: ["jquery"]
            },
            "bootstrap-table": {
                deps: ["jquery", "bootstrap"]
            },
            "bootstrap-table-fixed": {
                deps: ["bootstrap-table"]
            },
            "layer": {
                deps: ["jquery"],
                exports: "layer"
            },
            "autocomplete": {
                deps: ['jquery']
            },
            "moment": {
                deps: ['jquery']
            },
            "daterangepicker": {
                deps: ["jquery", "moment"],
                exports: "daterangepicker"
            },
            "chinese": {
                deps: ["jquery", "bootstrap-table"],
            },

            "public": {
                deps: ["jquery", "bootstrap-table", "moment", "daterangepicker"]
            }
        }
    });
    require(["autocomplete", "public", "layer", "chinese", "bootstrap-table-fixed"], function() {
        layer.config({
            path: 'http://static-online.zhaogangtest.com/publicresource/control/layer/'
        });
        $(function() {
            page = {
                init: function() {
                    this.bootstrapTable();
                    this.autocomplete();
                    this.fn_layer();

                    var that = this;
                    $(window).resize(function() {
                        $('#table-parent').bootstrapTable('resetView', {
                            height: that.getHeight()
                        });
                        $('.daterangepicker').hide()
                    });
                    $.daterangepicker("#datepicker", {
                        singleDatePicker: false,
                    });

                },
                bootstrapTable: function() {
                    $('#table-parent').bootstrapTable({
                        pagination: true, //在表格底部显示分页工具栏
                        pageSize: 50,
                        pageNumber: 1,
                        pageList: [10, 25, 50, 100],
                        height: page.getHeight(),
                        showFooter: false,
                        showColumns: false,
                        showRefresh: false,
                        //                    showToggle:true,
                        search: false,
                        //                    showPaginationSwitch:true,
                        detailView: true,
                        detailFormatter: page.showdetail,
                        // detailFormatter: this.showChild,
                        // onExpandRow: this.expandRow,
                        // onCollapseRow: this.collapseRow,
                        locales: 'zh-CN',
                        fixedColumns: false,
                        fixedNumber: 1,
                        url: '../data/erp/tablelist-inventoryadjust-manage.json',
                        sidePagination: "server", //分页方式：client客户端分页，server服务端分页（*）

                        columns: [{
                            "field": "n0",
                            "title": "序号",
                            formatter: function(value, row, index) {
                                return index + 1
                            },
                            // footerFormatter: "合计"
                        }, {
                            "field": "n1",
                            "title": "状态",
                        }, {
                            "field": "n2",
                            "title": "制单日期",
                        }, {
                            "field": "n3",
                            "title": "调整单号",
                        }, {
                            "field": "n4",
                            "title": "调整仓库",
                        }, {
                            "field": "n5",
                            "title": "调整库房",

                        }, {
                            "field": "n6",
                            "title": "班组",
                        }, {
                            "field": "n7",
                            "title": "制单人",
                        }, {
                            "field": "n8",
                            "title": "机构",
                        }, {
                            "field": "n9",
                            "title": "部门",
                        }, {
                            "field": "n10",
                            "title": "备注",
                            footerFormatter: public.fn_sumformatter,

                        }]
                    });
                },
                showdetail: function(a, b, c) {
                    $(c).append(
                        '<div class="box-body"><table class="table table-condensed innerTable" id="tabledetail' +
                        a + '"></table></div>');
                    $('#tabledetail' + a).bootstrapTable({
                        pagination: false, //在表格底部显示分页工具栏
                        showFooter: true,
                        locales: 'zh-CN',
                        url: '../data/erp/tablelist-inventoryadjust-manage-child.json',
                        sidePagination: "server", //分页方式：client客户端分页，server服务端分页（*）
                        columns: [{
                                "field": "n0",
                                "title": "序号",
                                formatter: function(value, row, index) {
                                    return index + 1
                                },
                                footerFormatter: "合计"
                            }, {
                                "field": "n1",
                                "title": "品类"
                            },
                            {
                                "field": "n2",
                                "title": "品名"
                            },
                            {
                                "field": "n3",
                                "title": "材质",
                            },
                            {
                                "field": "n4",
                                "title": "规格"
                            },
                            {
                                "field": "n5",
                                "title": "品质"
                            }, {
                                "field": "n6",
                                "title": "计量方式",
                            }, {
                                "field": "n7",
                                "title": "件支数",
                            }, {
                                "field": "n8",
                                "title": "产品类型",
                            }, {
                                "field": "n9",
                                "title": "调整数量",
                            }, {
                                "field": "n10",
                                "title": "调整重量",
                            }, {
                                "field": "n11",
                                "title": "备注",
                            }, {
                                "field": "n12",
                                "title": "调整类型",
                            }
                        ],

                    });
                },
                fn_layer: function() {
                    //添加
                    $(document).on('click', '.btn-adjust-item', function() {
                        layer.open({
                            type: 1, //page层
                            area: ['400px', 'auto'],
                            title: '提示',
                            shadeClose: false,
                            btn: ['确定', '取消'],
                            shade: 0.01, //遮罩透明度
                            moveType: 1, //拖拽风格，0是默认，1是传统拖动
                            shift: -1, //0-6的动画形式，-1不开启
                            content: $('.layer-adjust-item'),
                            skin: "skin-searchMore skin-overflow",
                            yes: function() {}
                        });
                    })
                    //查看
                    $(document).on('click', '.btn-delete-item', function() {
                        layer.open({
                            type: 1, //page层
                            area: ['400px', 'auto'],
                            title: '提示',
                            shadeClose: false,
                            btn: ['确定', '取消'],
                            shade: 0.01, //遮罩透明度
                            moveType: 1, //拖拽风格，0是默认，1是传统拖动
                            shift: -1, //0-6的动画形式，-1不开启
                            content: $('.layer-delete-item'),
                            skin: "skin-searchMore skin-overflow",
                            yes: function() {}
                        });
                    })
                    //废弃
                    $(document).on('click', '.btn-account', function() {
                        layer.open({
                            type: 1, //page层
                            area: ['400px', 'auto'],
                            title: '提示',
                            shadeClose: false,
                            btn: ['确定', '取消'],
                            shade: 0.01, //遮罩透明度
                            moveType: 1, //拖拽风格，0是默认，1是传统拖动
                            shift: -1, //0-6的动画形式，-1不开启
                            content: $('.layer-account'),
                            skin: "skin-searchMore skin-overflow",
                            yes: function() {
                            }
                        });
                    })
                },
                autocomplete: function() {
                    var data = ['上海钢找塑料', '上海钢富信息科技有限技有限公司', '上海找油网信息科技', '上海长城实业有限公司',
                        '上海找油网信息科技', '上海长城实业有限公司'
                    ]
                    $("#company input").autocomplete({
                        lookup: data,
                        minChars: 0,
                        appendTo: '#companywrap',
                        onSelect: function(suggestion) {
                            // $(this).val(suggestion.value);
                        },
                    });
                    $("#company1 input").autocomplete({
                        lookup: data,
                        minChars: 0,
                        appendTo: '#companywrap1',
                        onSelect: function(suggestion) {
                            // $(this).val(suggestion.value);
                        },
                    });
                    $("#company2 input").autocomplete({
                        lookup: data,
                        minChars: 0,
                        appendTo: '#companywrap2',
                        onSelect: function(suggestion) {
                            // $(this).val(suggestion.value);
                        },
                    });
                    $("#company3 input").autocomplete({
                        lookup: data,
                        minChars: 0,
                        appendTo: '#companywrap3',
                        onSelect: function(suggestion) {
                            // $(this).val(suggestion.value);
                        },
                    });
                    $("#company4 input").autocomplete({
                        lookup: data,
                        minChars: 0,
                        appendTo: '#companywrap4',
                        onSelect: function(suggestion) {
                            // $(this).val(suggestion.value);
                        },
                    });
                },
                // 表格高度
                getHeight: function() {
                    var _height = $('.form-list').outerHeight(
                        true) + $('.operation').outerHeight(true)
                    return $(window).height() - _height - 20;
                },
            }
            page.init();
        })
    })
    </script>
</body>

</html>